﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.Lesson
{
    public partial class add_new_lesson : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string name = Request.QueryString["name"];
            string role = Request.QueryString["role"];
            string active = Request.QueryString["active"];
            bool bo_active = false;
            if (active == "1")
                bo_active = true;


            new TblLessonController().Insert(name, true, role, bo_active, "","");

            var get_last = new TblLessonController().FetchAll().Last();

            int id = get_last.LessonId;

            new TblLessonReadingController().Insert(id, "", "", true);
            new TblLessonReadingController().Insert(id, "", "", true);
            new TblLessonTalkingController().Insert(id, "", "", "","", true);
        }
    }
}